﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using BUS;
using DevComponents.DotNetBar;

namespace Nhom16_PTTKHTTT_12HCB
{
    public partial class frmMain : DevComponents.DotNetBar.Office2007Form
    {

        frmPhucVu frmphucvu = null;
        frmThucDon frmthucdon = null;
        frmKhoHang frmkhohang = null;
        frmHoaDon frmhoadon = null;
        frmNhanVien frmNhanVien = null;
        frmQuanLyNhanVien frmQuanLyNhanVien = null;
        frmLenDanhSachMonAn frmLenDSmonAn = null;
        frmKhachHang frmkhachhang = null;
        public frmMain()
        {
            InitializeComponent();
        }

        private void menuKhachHang_Click(object sender, EventArgs e)
        {
            if (frmkhachhang == null || frmkhachhang.IsDisposed)
            {
                frmkhachhang = new frmKhachHang();
                frmkhachhang.MdiParent = frmMain.ActiveForm;
                frmkhachhang.Show();
            }
            else
                frmkhachhang.Activate();
            
        }

        private void menuPhucVu_Click(object sender, EventArgs e)
        {
            if (frmphucvu == null || frmphucvu.IsDisposed)
            {
                frmphucvu = new frmPhucVu();
                frmphucvu.MdiParent = frmMain.ActiveForm;
                frmphucvu.Show();
            }
            else
                frmphucvu.Activate(); ;
        }

        private void menuThucDon_Click(object sender, EventArgs e)
        {          
        }

        private void menuKhoHang_Click(object sender, EventArgs e)
        {
            if (frmkhohang == null || frmkhohang.IsDisposed)
            {
                frmkhohang = new frmKhoHang();
                frmkhohang.MdiParent = frmMain.ActiveForm;
                frmkhohang.Show();
            }
            else
                frmkhohang.Activate(); 
        }

        private void menuHoaDon_Click(object sender, EventArgs e)
        {
            if (frmhoadon == null || frmhoadon.IsDisposed)
            {
                frmhoadon = new frmHoaDon();
                frmhoadon.MdiParent = frmMain.ActiveForm;
                frmhoadon.Show();
            }
            else
                frmphucvu.Activate(); 
        }

        private void menuThongKe_Click(object sender, EventArgs e)
        {

        }

        private void menuNhanVien_Click(object sender, EventArgs e)
        {
            if (frmNhanVien == null || frmNhanVien.IsDisposed)
            {
                frmNhanVien = new frmNhanVien(1);
                frmNhanVien.MdiParent = frmMain.ActiveForm;
                frmNhanVien.Show();
            }
            else
                frmNhanVien.Activate();
        }

        private void đĂNGXUẤTToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if(MessageBox.Show("Bạn có chắc chắn muốn thoát chuong trình không","Thông Báo",MessageBoxButtons.YesNo,MessageBoxIcon.Question) == DialogResult.Yes)
            {
                ThongTinDangNhap.DangXuat();
                this.Close();
                Application.Exit();
            }
        }
        public void HT()
        {

           
        }
        void MacDinh()
        {
            menuPhucVu.Enabled = false;
            menuThucDon.Enabled = false;
            menuKhoHang.Enabled = false;
            menuHoaDon.Enabled = false;
            menuNhanVien.Enabled = false;
            menuKhachHang.Enabled = false;
        }
        private void frmMain_Load(object sender, EventArgs e)
        {

        }

        private void pHỤCVỤToolStripMenuItem_Click(object sender, EventArgs e)
        {


        }

        private void qUẢNLÝToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (frmQuanLyNhanVien == null || frmQuanLyNhanVien.IsDisposed)
            {
                frmQuanLyNhanVien = new frmQuanLyNhanVien();
                frmQuanLyNhanVien.MdiParent = frmMain.ActiveForm;
                frmQuanLyNhanVien.Show();
            }
            else
                frmQuanLyNhanVien.Activate();
        }

        private void lênDanhSáchMónToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (frmQuanLyNhanVien == null || frmQuanLyNhanVien.IsDisposed)
            {
                frmLenDSmonAn = new frmLenDanhSachMonAn();
                frmLenDSmonAn.MdiParent = frmMain.ActiveForm;
                frmLenDSmonAn.Show();
            }
            else
                frmLenDSmonAn.Activate();
        }       
              
    }
}
